﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<% 
    BIZ.InfomationPublishOper ipo = new BIZ.InfomationPublishOper();  
%>
<!--阅读指导-->
<div class="chose_book_box w_980 clearfix">
	<!--menu-->
	<div class="menu">
    	<h2>阅读指导</h2>
        <div class="menu_main">
        	<ul>
            <%
                int id = int.Parse((Request["i"] == null ? "0" : Request["i"].ToString()));
                IList lixszd = ipo.getlistweb(1, 10, (int)DAL.Enums.template.阅读分享);
                StringBuilder sb = new StringBuilder();
                int countInt = 0;
                foreach (Hashtable htb in lixszd)
                {
                    if (htb["total"] == null)
                    {
                        sb.Append("<li><a href=\"/template/read.html?i=" + (htb["i_id"] == null ? "" : htb["i_id"].ToString()) + "\" selected" + (htb["i_id"] == null ? "" : htb["i_id"].ToString()) + ">" + (htb["i_title0"] == null ? "" : htb["i_title0"].ToString()) + "</a></li>");
                        if (countInt == 0)//如果是第一次打开。默认显示第一笔数据
                        {
                            if (id == 0)
                            {
                                id = int.Parse(htb["i_id"].ToString());
                            }
                        }
                        countInt++;
                    }     
                }
                IList lijz = ipo.getlistweb(1, 10, (int)DAL.Enums.template.家长指导手册);
                foreach (Hashtable htb in lijz)
                {
                    if (htb["total"] == null)
                    {
                        sb.Append("<li><a href=\"/template/read.html?i=" + (htb["i_id"] == null ? "" : htb["i_id"].ToString()) + "\" selected" + (htb["i_id"] == null ? "" : htb["i_id"].ToString()) + ">" + (htb["i_title0"] == null ? "" : htb["i_title0"].ToString()) + "</a></li>");
                    }
                }
                Response.Write(sb.ToString().Replace("selected" + id.ToString(), "class=\"selected\""));
            %>
            </ul>
        </div>
        <b></b>
    </div>
    <% 
    IList li = ipo.getinfomationbyid(id);
    Hashtable tb = new Hashtable();
    if (li.Count > 0)
        tb = (Hashtable)li[0];
    %>
    <!--info_box-->
    <div class="right_info_box">
    	<!--main-->
    	<div class="info_box">
        	<!--title-->
        	<div class="info_box_title">
            	<h3><%=tb["i_title0"] %></h3>
                <p><a href="/index.html">首页</a>&gt;<a href="/template/read.html">阅读指导</a>&gt;<span><%=tb["i_title0"] %></span></p>
            </div>
            <div class="info_box_main">
            	<h4><%=tb["i_title1"]%></h4>
                <div class="info_box_time"><%=(tb["i_addTime"] == null ? "" : DateTime.Parse(tb["i_addTime"].ToString()).ToString("yyyy年MM月dd日HH:mm"))%><span>嘉沃阅读馆</span></div>
                <div class="info_box_main_txt">
                	<%=tb["i_content"]%>
                </div>
            </div>
        </div>
    </div>
</div>

</asp:Content>
